package com.mls.fivedistrict.dao;

import com.mls.fivedistrict.pojo.User;
import com.mls.fivedistrict.pojo.UserAndAuth;
import com.mls.fivedistrict.pojo.UserExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Long id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    List<User> selectByExampleForTask(UserExample example);

    User selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    Long normalCalculateSum(Integer minParticipationCalculate);

    Long subscribeUserCalculateSum(Integer minParticipationCalculate);

    User selectInviterUser(Long inviter_user_id);

    int updateCalculateBatch(Set<User> list);

    List<UserAndAuth> selectInvitersUser(@Param("inviter_user_id") Long inviter_user_id);

    List<UserAndAuth> search(@Param("params") Map<String, Object> params);

    long getCalculateSum();

    long getMaxId();

    User getUserById(Long id);

    List<User> selectUserForInviteReal(@Param("params") Map params);

    List<User> selectUserForInviteNoReal(@Param("params") Map params);

    int updateUserInvite(Long userId);

    User selectSingleUser(@Param("userId") Long userId);

    User selectUserAndInvite(@Param("userId") Long userId);


}